<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('登录日志列表')" />
</head>
<body class="gray-bg">
	<div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="logininfo-form">
					<div class="select-list">
						<ul>
							<li>
								<label>登录地址：</label><input type="text" name="ipaddr" placeholder="请输入登录地址"/>
							</li>
							<li>
								<label>登录名称：</label><input type="text" name="loginName" placeholder="请输入登录名称"/>
							</li>
							<li>
								<label>登录状态：</label><select name="status" th:with="type=${@dict.getDict('sys_success_status')}">
									<option value="">所有</option>
									<option th:each="dict : ${type}" th:text="${dict.dictName}" th:value="${dict.dictValue}"></option>
								</select>
							</li>
							<li class="select-time">
								<label>登录时间： </label>
								<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="query[startTime]"/>
								<span>-</span>
								<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="query[endTime]"/>
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-default btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
			<div class="btn-group-sm" id="toolbar" role="group">
				<a class="btn btn-primary multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="monitor:logininfo:remove">
		            <i class="fa fa-trash"></i> 删除
		        </a>
		        <a class="btn btn-primary" onclick="$.operate.clean()" shiro:hasPermission="monitor:logininfo:remove">
	                <i class="fa fa-remove"></i> 清空
	            </a>
	        </div>
        
	        <div class="col-sm-12 select-table table-striped">
			    <table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
	
	<th:block th:include="include :: footer" />
	<script th:inline="javascript">
		var prefix = ctx + "monitor/logininfo";
	
		$(function() {
		    var options = {
		        url: prefix + "/list",
		        cleanUrl: prefix + "/clean",
		        removeUrl: prefix + "/remove",
		        sortName: "createTime",
		        sortOrder: "desc",
		        modalName: "登录日志",
		        columns: [{
		            checkbox: true
		        },
		        {
		            field: 'id',
		            visible: false
		        },
		        {
		            field: 'loginName',
		            title: '登录名称',
		            sortable: true
		        },
		        {
		            field: 'ipaddr',
		            title: '登录地址'
		        },
		        {
		            field: 'loginLocation',
		            title: '登录地点'
		        },
		        {
		            field: 'browser',
		            title: '浏览器'
		        },
		        {
		            field: 'os',
		            title: '操作系统'
		        },
		        {
		            field: 'status',
		            title: '操作状态',
		            align: 'center'
		        },
		        {
		            field: 'msg',
		            title: '操作信息'
		        },
		        {
		            field: 'createTime',
		            title: '操作时间',
		            sortable: true
		        }]
		    };
		    $.table.init(options);
		});
	</script>
</body>
</html>